Skip to content

feat: tile size manager#440

Open
MaFo-28 wants to merge 6 commits intoeddyizm:developmentfrom
MaFo-28:TileSizeManager
Open

feat: tile size manager#440
MaFo-28 wants to merge 6 commits intoeddyizm:developmentfrom
MaFo-28:TileSizeManager

Conversation

@MaFo-28
Copy link
Contributor

@MaFo-28 MaFo-28 commented Feb 14, 2026

Instead of only increasing items per row on landscape, this PR implements a tile size manager offering 5 different sizes.
Since this calculates either the size or the number of elements to display, there is no need to detect the orientation.

Settings:

TileSize

Home views:

home_XL home_L home_M home_S home_XS

Albums views:

albums_XL albums_L albums_M albums_S albums_XS

XL landscape view:

albums_Horiz_XL

M landscape view:
albums_Horiz_M

@tvillega
Copy link
Contributor

Hi! I made the old code that hardcoded items per row, so I got excited to check out this better, proper implementation (=

I tested it on my phone and the app crashes after a few seconds in landscape, strangely it does not happen on my tablet. Using the Small tile size leads to some performance issue, which is most likely related to #208 and #388 and not caused by this.

Also, this addresses #323 perfectly (at least part of it).

I do think that the scale could use some other labels:

- Tiny
- Small
- Medium
- Large
- Default

The Xtra Large is the current default of Tempus, that would orientate users used to the old layout. The Xtra Small fits really well with small-screen devices, so calling it tiny could hint that.

@MaFo-28
Copy link
Contributor Author

MaFo-28 commented Feb 14, 2026

You're right about the labels, your suggestion is more in line.

I've tested the rotation several times on my phone and on a virtual device and I've never had a crash.
And since rotation detection isn't used, I don't see what could cause this.

Can you elaborate on what leads to the crash?

@tvillega
Copy link
Contributor

I followed these steps:

  1. I pressed the 'Run app' button on Android Studio while on your PR, that installed the app on my phone.
  2. I configured my login in portrait mode, then I entered the principal screen of Tempus.
  3. I put the phone on landscape to trigger the orientation change.
  4. The app starts populating the albums (the normal stuff) and without me making any other interaction it crashed.

Keeping my phone on landscape and opening the app again makes 4. repeat. I'll wait for eddyizm to see if he can replicate the crash since this is really strange. Best case scenario is just git doing the checkout wrong on my end.

@tvillega
Copy link
Contributor

I decided to use your repo directly to test again and I got the following in the IDE:

Screenshot_20260214_151710

That happened to me before, I just copy-pasted the file by hand thinking that was a mistake of mine. This shouldn't happen using your repo directly, so its highly likely the crash is just my git not pulling all the changes.

I never faced this before, so I'll consider my crash just a git issue on my end. I'll test it again once its merged.

@MaFo-28
Copy link
Contributor Author

MaFo-28 commented Feb 14, 2026

TileSizeManager.java should be located in tempus directory
AndroidStudio

I haven't been able to reproduce crash, and even if we're not sure of the origin, I've added protection against invalid tile size preferences.

@tvillega
Copy link
Contributor

tvillega commented Feb 14, 2026

I rewrote this entire comment to update it with useful info.

You implemented TileSizeManager in the tempus variant, that means that the file is not available for the degoogled variant. You need to move the file to the common code section:

image

I always test on degoogled, that's why my IDE said the file is missing. Copying the file resolved it, that's how I managed to test it the first time. Following the same file hierarchy works, it's just that during the build process files from the other variant are ignored if they are not part of the 'shared code'.

I ran now the tempus variant and followed the steps to trigger the crash, this is the output from logcat. Search for the string FATAL EXCEPTION. I hope it helps.

@MaFo-28
Copy link
Contributor Author

MaFo-28 commented Feb 15, 2026

I moved TileSizeManager to the correct directory.

Thanks for the logcat; it helped me understand the problem.
DiscoverSongSlide was a ViewPager2 and doesn't support certain resizing.
I replaced it with a RecyclerView, modified the associated XML, and applied the dynamic sizing as in the other adapters.
After a lot of testing, everything seems to be working now.

@tvillega
Copy link
Contributor

Nice! I tested the tempus variant and the degoogled variant in your latest commit and the crash is gone, all working as expected (=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants